import { RouteRecordRaw } from 'vue-router'
import { Ad, TicketAlt } from '@vicons/fa'
import { CustomerServiceFilled, FireFilled } from '@vicons/antd'
import { renderIcon } from '@/util'
import { LocalLaundryServiceFilled } from '@vicons/material'

declare module 'vue-router' {
    interface RouteMeta {
        title?: string
        role?: string
        icon?: any
        sort?: number
        real?: boolean
    }
}

const routes: Array<RouteRecordRaw> = [
    {
        path: '/opx',
        name: 'opx',
        redirect: '/opx/adv',
        component: () => import('@/views/layout/Index.vue'),
        meta: {
            title: '运营管理',
            icon: renderIcon(FireFilled),
            role: 'Dev,Adm',
            sort: 4,
        },
        children: [
            {
                path: 'adv',
                name: 'opx.adv',
                meta: {
                    title: '广告配置',
                    icon: renderIcon(Ad),
                    role: 'Adm',
                },
                component: () => import('@/views/opx/adv/Index.vue'),
            },
            {
                path: 'coupon',
                name: 'opx.coupon',
                meta: {
                    title: '优惠券',
                    icon: renderIcon(TicketAlt),
                    role: 'Adm',
                },
                component: () => import('@/views/opx/coupon/Index.vue'),
            },
            {
                path: 'faq',
                name: 'opx.ins',
                meta: {
                    title: '增值服务',
                    icon: renderIcon(LocalLaundryServiceFilled),
                    role: 'Adm',
                },
                component: () => import('@/views/opx/srvs/Index.vue'),
            },
            {
                path: 'faq',
                name: 'opx.faq',
                meta: {
                    title: '自助客服',
                    icon: renderIcon(CustomerServiceFilled),
                    role: 'Adm',
                },
                component: () => import('@/views/opx/faq/Index.vue'),
            },
        ],
    },
]

export default routes
